<template>
	<view class="content">
		<view class="list" v-for="(item,index) in list" :key="index">
			<view class="top">
				<view class="title">{{item.recordType}}</view>
				<view class="price">+{{item.walletNum}}</view>
			</view>
			<view class="buttom">
				<view class="time">{{item.createTime}}</view>
				<view class="status">{{item.status==0?'待审核':item.status==1?'审核通过':'审核驳回'}}</view>
			</view>
		</view>
		<view class="noneContent" v-if="list.length == 0">
			<image src="../../static/withdraw/noneCard.png" class="noneImg"></image>
			<view class="tips">暂无数据</view>
		</view>
	</view>
</template>

<script>
	import { rechargeRecord } from '../../api/api.js'
	export default {
		data() {
			return {
				// 充值记录列表
				list:[],
				pageNum:1,
				pageSize:20,
				pages:''
			}
		},
		onShow() {
			this.pageNum = 1
			this.list = []
			// 获取充值记录列表
			this.getList()
		},
		onReachBottom() {
			if(this.pages <= this.pageNum) {
				uni.showToast({
					icon:'none',
					title:'暂无更多~'
				})
				return
			}else {
				this.pageNum ++
				// 获取充值记录列表
				this.getList()
			}
		},
		methods: {
			// 获取充值记录列表
			getList() {
				let data = {
					pageNum:this.pageNum,
					pageSize:this.pageSize,
					type:3
				}
				rechargeRecord(data).then( res=> {
					this.list = this.list.concat(res.data.records)
					this.pages = res.data.pages
				})
			}
		}
	}
</script>

<style lang="less">
  .content {
		.list {
			margin: 35rpx 0 0 30rpx;
			width: 690rpx;
			border-bottom:1rpx solid #F2F2F2;
			padding-bottom: 15rpx;
			.top {
				display: flex;
				align-items: center;
				justify-content: space-between;
				.title {
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #000000;
					line-height: 40rpx;
				}
				.price {
					font-size: 32rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FE3B33;
					line-height: 45rpx;
				}
			}
			.buttom {
				margin-top: 16rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				.time {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
					line-height: 33rpx;
				}
				.status {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #CA0000;
					line-height: 33rpx;
				}
			}
		}
		.noneContent {
			display: flex;
			align-items: center;
			flex-direction: column;
			.noneImg {
				margin-top: 132rpx;
				width: 320rpx;
				height: 291rpx;
			}
			.tips {
				margin-top: 36rpx;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #B8B8B8;
				line-height: 33rpx;
			}
		}
	}
</style>
